<!DOCTYPE html>
<html lang="es">
	<head>
		<title>Aprendiendo jQuery</title>
		<script src="jquery-1.8.3.min.js"> </script>
		<script type="text/javascript">	
		function jqeventosperso(){
			$(document).on('ready', function(){
				$("#miInput").on('cambio', function(e, id){
					alert(id);
					if(this.checked)
					{
						$("#miInput").removeAttr('checked');
						$('.change').text('Encender');
					}
					else
					{
						$("#miInput").attr('checked', 'checked');
						$('.change').text('Apagado');
					}
				});
				
				$('.change').on('click', function(){
					$("#miInput").trigger('cambio',[$(this).attr('id')]);
				});
			});
		}
		</script>
	</head> 
	<body>
		<input type="checkbox" id="miInput" checked="checked"> Check
		<button class="change" id="btn1">Apagar 1</button>
		<button class="change" id="btn2">Apagar 2</button>

		<!--<script type="text/javascript" src="http://www.rfsouto.com/Scripts/capitulo12.js"></script>-->
		<script type="text/javascript">
		<!--
		jqeventosperso();
		//-->
		</script>
	</body>
</html>